<?php
include_once BONE_ROOT.DS.APP_DIR.DS.'templates'.DS.'menu'.DS.'menu.php';

class template_group_listing extends template_menu
{

	protected function center()
	{
		
		$group_list = $this->get('group_list');
		$this->toolbar();
		?>

<div class="box">
	<div class="box-tl"><div class="box-tr"><div class="box-tm"></div></div></div>	
	<div class="box-m">
		
		<h3 class="title"><?php echo $this->get_title(); ?></h3>
		
		<table class="list-table">
		
		<thead>
		<tr>
			<th>名称/子菜单数量</th><th width="60">调用类名</th><th width="60">调用范围</th><th width="120">管理</th>
		</tr>
		</thead>
		
		<tbody>
		<?php 
		$k=0;
		foreach($group_list as $group)
		{
		?>
		<tr class="row<?php echo $k;?>">
		<td><a href="./?controller=menu&task=listing&group_id=<?php echo $group->id; ?>"><?php echo $group->name; ?></a></td>
		<td align="center"><?php echo $group->class_name; ?></td>
		<td align="center"><?php echo $group->is_backend?'后台':'前台'; ?></td>
		<td align="center">
			<a href="./?controller=menu&task=group_edit&group_id=<?php echo $group->id; ?>">编辑</a> &nbsp; 
			<?php if($group->class_name!='main' && $group->class_name!='foot'){ ?>
				<a href="./?controller=menu&task=group_delete&group_id=<?php echo $group->id; ?>">删除</a>
			<?php } ?>
		</td>
		</tr>		
		<?php
		$k = 1-$k;
		}
		?>
		</tbody>
		
		<tfoot>
		<tr>
			<td colspan="4"><div class="align-left"><input type="button" value="新建菜单组" onclick="javascript:window.location.href='./?controller=menu&task=group_edit';"></div></td>
		</tr>
		</tfoot>
		</table>
		<div class="info">
		<ul>
		<li>* 调用类名用作开发人员调用 格式: bone::get_menu('main');</li>
		<li>* 其中命名为 main 的菜单是主要菜单, 受系统保护，请不要轻易移除.</li>
		</ul>
		</div>
	</div>
	<div class="box-bl"><div class="box-br"><div class="box-bm"></div></div></div>
</div>
		

		<?php
		
	}	

}
?>